package com.wintrue.ffxs.http.task;

import android.content.Context;

import com.alibaba.fastjson.JSON;
import com.wintrue.ffxs.bean.User;
import com.wintrue.ffxs.http.AbstractHttpTask;
import com.wintrue.ffxs.http.HttpClientApi;

public class LoginTask extends AbstractHttpTask<User> {

    public LoginTask(Context context, String phone,String password,String code) {
        super(context);
        mDatas.put("phone", phone);
        mDatas.put("password", password);
        mDatas.put("verifyCode", code);
    }

    @Override
    public String getUrl() {
        return HttpClientApi.USER_LOGIN;
    }

    @Override
    public Method getMethod() {
        return Method.POST;
    }

    @Override
    public User parse(String data) {
        return JSON.parseObject(data,User.class);
    }

}
